package com.mvu.banana.domain.stub;
import com.mvu.banana.domain.client.Gender;
import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import com.mvu.banana.domain.impl.KeyableBean;
import javax.persistence.Entity;
import java.util.Date;
import org.hibernate.validator.constraints.Email;

@Entity
public class Profile extends KeyableBean{

  @Length(min = 2, max = 30)
  @NotNull
  protected String name;

  @NotNull
  @Email
  protected String email;

  @NotNull
  protected Gender gender;

  @NotNull
  protected Date birthDate;

  @ManyToOne
  protected Credential credential;

  public static final String NAME_PROP = "name";

  public static final String EMAIL_PROP = "email";

  public static final String GENDER_PROP = "gender";

  public static final String BIRTHDATE_PROP = "birthDate";

  public static final String CREDENTIAL_PROP = "credential";

  public String getName(){
    return name;
  }

  public Profile setName(String p0){
    this.name = p0;
    return this;
  }

  public String getEmail(){
    return email;
  }

  public Profile setEmail(String p0){
    this.email = p0;
    return this;
  }

  public Gender getGender(){
    return gender;
  }

  public Profile setGender(Gender p0){
    this.gender = p0;
    return this;
  }

  public Date getBirthDate(){
    return birthDate;
  }

  public Profile setBirthDate(Date p0){
    this.birthDate = p0;
    return this;
  }

  public Credential getCredential(){
    return credential;
  }

  public Profile setCredential(Credential p0){
    this.credential = p0;
    return this;
  }

  public String toString(){
    StringBuilder builder = new StringBuilder();
    builder.append("name=").append(this.name).append(", ");
    builder.append("email=").append(this.email).append(", ");
    builder.append("gender=").append(this.gender).append(", ");
    builder.append("birthDate=").append(this.birthDate).append(", ");
    builder.append("credential=").append(this.credential).append(", ");
    return builder.toString();
  }
}